{include file="public/header" /}

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <form class="layui-form layui-col-space5">
                        <div class="layui-inline layui-show-xs-block">
                            <input type="text" name="title" placeholder="分类名称搜索" value="{:input('get.title')}"
                                autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <select name="shopid" lay-verify="" lay-search='' lay-filter="shopid">
                                <option value="">输入名称快速查找</option>
                                {foreach $shoplist as $v}
                                <option value="{$v.id}" {if !empty(input('get.shopid')) &&
                                    input('get.shopid')==$v.id}selected{/if}>
                                    {$v.title|default=''}(账号:{$v.account|default=''})</option>
                                {/foreach}
                            </select>
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <button class="layui-btn  layui-btn-normal" lay-submit="" lay-filter="sreach">搜索</button>
                        </div>
                    </form>
                </div>
                <div class="layui-card-header">
                    <button class="layui-btn  layui-btn-normal" onclick="data_edit('添加','cate_edit')"><i
                            class="layui-icon">&#xe654;</i>添加</button>&nbsp;
                    共有数据：<strong id="count">{$list->total()}</strong> 条
                </div>
                <div class="layui-card-body layui-table-body layui-table-main">
                    <table class="layui-table layui-form">
                        <thead>
                            <tr>
                                <th>ID</th>
                                <th>名称</th>
                                <th>商家</th>
                                <th>排序</th>
                                <th>显示[分类不可删，请选择隐藏]</th>
                                <th>是否热门</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            {foreach $list as $v}
                            <tr>
                                <td>{$v.id|default='0'}</td>
                                <td>{$v.name|default=''}</td>
                                <td>{$v.shopname|default=''}</td>
                                <td>{$v.sorts|default=''}</td>
                                <td>
                                    {if $v.ishow == 1}
                                    显示
                                    {else/}
                                    隐藏
                                    {/if}
                                </td>
                                <td>
                                    {if $v.ishot == 1}
                                    是
                                    {else/}
                                    否
                                    {/if}
                                </td>
                                <td class="td-manage">
                                    <a title="操作" onclick="data_edit('操作','/system/cate_edit?id={$v.id}')"
                                        href="javascript:;" class="layui-btn layui-btn-normal">
                                        操作
                                    </a>
                                </td>

                            </tr>
                            {/foreach}

                        </tbody>
                    </table>
                </div>
                <div class="layui-card-body ">
                    <div class="page">
                        {$list->render()|raw}
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>
</body>
{include file="public/footer"}
<script>
    layui.use(['form', 'upload'], function () {
        var $ = layui.jquery
            , form = layui.form
            , layer = layui.layer;
    });
</script>